<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags/general" %>

<c:set var="basePath" value="${pageContext.servletContext.contextPath}"/>
<t:template>
<div style ="background-color:white;">
	<form:form action="${basePath}/bank/ibank/accounts/add" commandName="account" method="post">
	<table >
	<tr>
		<td colspan="3"><h3>Add new account</h3></td>
	</tr>
	<tr class="m">
		<td style="width: 120px;">Full name:</td>
		<td>${customerInfo.name}, ${customerInfo.surname}</td>
		<td></td>
	</tr>	
	<tr class="alt">
		<td>Person code:</td>
		<td>${customerInfo.personCode}</td>
		<td></td>
	</tr>		
	<tr class="m">
		<td>Choose account type:</td>
		<td>
			<form:select name="AccountTypes" path="accountTypeId">
			    <c:forEach var="type" items="${accountTypes}">
			        <option value="${type.accountTypeId}">${type.accountTypeName}</option>
			    </c:forEach>
			</form:select >		
		</td>
		<td></td>
	</tr>	
	<tr class="alt">
		<td>Choose account currency:</td>
		<td>
			<form:select name="AccountCurrency" path="currencyId">
			    <c:forEach var="currency" items="${AccountCurrency}">
			        <option value="${currency.currencyId}">${currency.currencyName}(${currency.currencyCountry})</option>
			    </c:forEach>
			</form:select>			
		</td>
		<td></td>
	</tr>		
	<tr class="m">
		<td></td>
		<td colspan="2"><input type="submit" value="Create account" /></td>
	</tr>
	</table>
	</form:form>
</div>
</t:template>

